package com.itany.corejava.code17_设计模式.工厂模式;

import com.itany.corejava.entity.Emp;
import com.itany.corejava.entity.Student;
import com.itany.corejava.entity.User;

import java.util.Date;

/**
 * @author 石小俊
 * @date 2023年06月02日 13:54
 */
public class Test {
    public static void main(String[] args) {
        User user = (User) ObjectFactory.getObject("user");
        User user2 = (User) ObjectFactory.getObject("user");
        Student student = (Student) ObjectFactory.getObject("student");
        Emp emp = (Emp) ObjectFactory.getObject("emp");
        System.out.println(user == user2);
        System.out.println(student);
        System.out.println(emp);
        Date date = (Date) ObjectFactory.getObject("date");
        System.out.println(date);

    }
}
